<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/9/4 0004
  Time: 下午 2:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../inc/top.jsp"%>
<%
  String id = request.getParameter("id") ;
%>
<center>
<h2 align="center"><strong>举报信息填写</strong></h2>
<br/>
<form action="<%=ctxpath%>/user/jubao?id=<%=id%>" method="post" name="jubao" id="jubao">
    <input class="form-control" name="id" id="id"><%=id%></input>
    <div>
        <label><h3>举报原因</h3></label>
        <input class="form-control" name="jubaoyuanyin" id="jubaoyuanyin"/>
    </div>
    <br/>
    <div>
        <label><h3>举报详情</h3></label>
        <textarea class="form-control" rows="10" name="jubaoxiangqing" id="jubaoxiangqing"></textarea>
    </div>
    <br/>
    <div align="center">
        <button class="btn btn-primary" type="submit" name="btnjubao" id="btnjubao">举报</button>
    </div>
    <br/>
    <div align="center">
        <h6 style="color: red">提示:举报信息真实性必须得到保证，否则你将对后果负全责</h6>
    </div>
</form>
</center>
<%@ include file="../inc/bottom.jsp"%>

<script>
    $(function () {
        $("#btnjubao").click(function() {
            if(queren()) {
                if(confirm("是否确定举报")) {
                    $("#jubao").submit();
                }

            }
        });
    });

    function queren() {
        var jubaoyuanyin = $("#jubaoyuanyin");
        var jubaoxiangqing = $("#jubaoxiangqing");
        var id =${"#id"} ;
        if(jubaoyuanyin.val() == "") {
            alert("举报原因不能为空");
            return false;
        }
        if(jubaoxiangqing.val() =="") {
            alert("举报详情不能为空");
            return false;
        }
        return true;
    }
</script>
